package com.example.bes11001.single.ds.demo1.controller;

import com.example.bes11001.single.ds.demo1.mapper.UserMapper;
import com.example.bes11001.single.ds.demo1.model.User;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class TestController {

    private static final Logger log = LoggerFactory.getLogger(TestController.class);

    @Autowired
    private UserMapper userMapper;

    @GetMapping
    public String test() {
        return "SUCCESS";
    }

    /**
     * 插叙所有用户数据
     * @return
     */
    @GetMapping(value = "/user/all")
    public List<User> selectAll() {
        return userMapper.selectUserList();
    }

}
